package io.a;

import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.SparkSession;

public class T1 {
    public static void main(String[] args) {

        SparkSession spark = SparkSession
                .builder()
                .appName("Java Spark SQL basic example")
                .config("spark.some.config.option", "some-value")
                .getOrCreate();

        Dataset<Row> df = spark.read().json("./sample-bd-spark/src/test/resources/people.json");

        df.printSchema();
        df.select("name").show();
        df.select("age").show();

        df.show();
    }
}
